package com.maxd.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 班级学员信息
 */
@Entity
@Getter
@Setter
@ToString
@SuperBuilder
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@ApiModel("班级学员信息")
@Table(name = "class_student_info")
public class ClassStudentInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @ApiModelProperty("自增主键")
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty("班级ID")
    @Column(name = "class_id", nullable = false)
    @NotNull(message = "班级不能为空")
    private Long classId;

    @ApiModelProperty("班级名称")
    @Column(name = "class_name", nullable = true)
    private String className;

    @ApiModelProperty("学员ID")
    @Column(name = "student_id", nullable = false)
    @NotNull(message = "学员不能为空")
    private Long studentId;

    @ApiModelProperty("学员姓名")
    @Column(name = "student_name", nullable = true)
    private String studentName;

    @ApiModelProperty("学员关联的用户ID")
    @Column(name = "user_id", nullable = true)
    private Long userId;

    @Column(name = "order_id", nullable = false)
    @NotNull(message = "订单号不能为空")
    @ApiModelProperty("关联订单号")
    private String orderId;

    @ApiModelProperty("生效时间，格式yyyy-MM-dd")
    @Column(name = "effect_time", nullable = false)
    @NotNull(message = "生效时间不能为空")
    private String effectTime;

    @ApiModelProperty("失效时间，格式yyyy-MM-dd")
    @Column(name = "expire_time", nullable = false)
    @NotNull(message = "失效时间不能为空")
    private String expireTime;

    @ApiModelProperty("状态 1-正常 0-删除")
    @Column(name = "status", nullable = false)
    private String status;

    @ApiModelProperty("创建时间")
    @Column(name = "create_time", nullable = false)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @Column(name = "update_time", nullable = false)
    private Date updateTime;

    @ApiModelProperty("创建人")
    @Column(name = "create_by")
    private String createBy;

    @ApiModelProperty("更新人")
    @Column(name = "update_by")
    private String updateBy;

}
